<template>
  <vxe-table-colgroup
    :title="colHeader.title"
    :field="colHeader.dataIndex"
    :min-width="colHeader.width"
    :align="colHeader.align || 'center'"
    :show-overflow="colHeader.ellipsis ? 'ellipsis':'tooltip'"
  >
    <template v-for="item in colHeader.children">
      <tableColumn
        v-if="item.children && item.children.length>0"
        :key="item.id+Math.random()+''"
        :coloumn-header="item"
      />
      <!-- 最底级 -->
      <template v-else>
        <table-cell :key="item.id+Math.random()+''" :item="item" />
      </template>
    </template>
  </vxe-table-colgroup>
</template>
<script>
import TableCell from './TableCell';
export default {
  name: 'TableCol',
  components: {
    TableCell
  },
  props: {
    colHeader: {
      type: Object,
      required: true
    }
  }
};
</script>
